#!/usr/bin/env python3

import os
this_file_directory = os.path.dirname(os.path.realpath(__file__))
fissure_directory = os.path.abspath(os.path.join(this_file_directory, os.pardir, os.pardir))

########################################################################
########################## DragonOS Noble ##############################
########################################################################

programs_dragonOS_noble = []

# Ubuntu Noble APT Sources
programs_dragonOS_noble.append(('Ubuntu Noble APT Sources (391.27 MB)',
"""# Add missing public GPG key for Ubuntu Noble
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

# Update package list
sudo apt-get update

########## Verify ##########
find /etc/apt/trusted.gpg.d/ -name '*.gpg' -exec gpg --no-default-keyring --keyring {} --list-keys 2>/dev/null \; | grep -F '871920D1991BC93C'
""", True, 'Minimum Install'))

# Misc. Dependencies
programs_dragonOS_noble.append(('Misc. Dependencies (2.36 GB)',
"""sudo apt-get -y update
sudo apt-get install -y ubuntu-standard
sudo apt-get install -y eog
#sudo apt-get -y install cmake
sudo apt-get install -y python-setuptools python-dev-is-python3 build-essential
sudo apt-get install -y curl
sudo apt-get install -y libssl-dev libffi-dev libsqlite3-dev tk-dev
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE/
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar xzf Python-2.7.18.tgz
cd Python-2.7.18
./configure --enable-optimizations
sudo make altinstall
sudo ln -s /usr/local/bin/python2.7 /usr/bin/python2
curl https://bootstrap.pypa.io./pip/2.7/get-pip.py | sudo python2  # Installs pip 20.3.4
sudo apt-get install -y python3-pip
sudo python3 -m pip install cmake --upgrade --break-system-packages
sudo apt install -y python3-testresources
sudo python3 -m pip install --upgrade setuptools --break-system-packages
sudo python3 -m pip install --upgrade virtualenv --break-system-packages
#sudo python3 -m pip install matplotlib --break-system-packages  # This version conflicts with yellowbrick
#sudo python3 -m pip install PyYAML==5.1 --break-system-packages
#sudo python3 -m pip install pyyaml --break-system-packages
#wget http://archive.ubuntu.com/ubuntu/pool/universe/p/python-scipy/python-scipy_0.19.1-2ubuntu1_amd64.deb
#sudo apt-get install -y ./python-scipy_0.19.1-2ubuntu1_amd64.deb  # FIX?
rm python-scipy_0.19.1-2ubuntu1_amd64.deb
sudo apt-get install -y gedit
sudo apt-get install -y software-properties-common #python-software-properties # does Python3
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get -y update
sudo apt-get install -y git 
#sudo apt-get install -y libcanberra-gtk-module
sudo python3 -m pip install bitarray --break-system-packages
#sudo apt install net-tools
#sudo python3 -m pip install crcmod --break-system-packages
sudo python3 -m pip install pycrypto --break-system-packages
sudo apt-get install -y python-tk
sudo python3 -m pip install pyzmq --break-system-packages
#sudo apt-get install -y libosmocore-dev
#sudo apt-get install -y liborc-0.4-dev
sudo apt-get install -y expect
sudo add-apt-repository --y ppa:wireshark-dev/stable  # Latest Wireshark
sudo apt-get update
#sudo python3 -m pip install pyshark --break-system-packages
sudo apt install -y debconf
echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections
sudo DEBIAN_FRONTEND=noninteractive apt install -y tshark
sudo python3 -m pip install pypcapfile --break-system-packages
sudo python2 -m pip install pypcapfile
sudo python2 -m pip install netaddr
#sudo python3 -m pip install psutil --break-system-packages
#sudo python3 -m pip install pyserial --break-system-packages
#sudo apt-get install -y gpsd-clients python3-gi-cairo
sudo python3 -m pip install pandas --break-system-packages
sudo apt-get install -y dsniff
sudo apt-get install -y ncurses-term
sudo python3 -m pip install yellowbrick --break-system-packages
sudo python3 -m pip install seaborn --break-system-packages
sudo apt-get install -y rtl-sdr
sudo python3 -m pip install gpsd-py3 --break-system-packages
sudo python3 -m pip install geopy --break-system-packages
sudo python3 -m pip install sounddevice --break-system-packages
sudo python3 -m pip install qasync --break-system-packages
sudo python3 -m pip install pydotplus --break-system-packages
python3 -m pip install tensorflow_cpu --break-system-packages
sudo apt-get install -y snapd
sudo snap install netron
sudo python3 -m pip install ipython --break-system-packages
sudo python3 -m pip install scikit-learn==1.3.2 --break-system-packages
sudo python3 -m pip uninstall opencv-python --break-system-packages
sudo python3 -m pip install opencv-python-headless --break-system-packages
sudo python3 -m pip install pyzipper --break-system-packages
sudo apt-get install -y unzip
sudo apt-get install -y usbutils
sudo python3 -m pip install mgrs --break-system-packages
sudo apt-get install -y debconf-utils
sudo apt-get install -y xdg-utils
sudo apt-get install -y p7zip-full
sudo python3 -m pip install watchdog --break-system-packages
sudo python3 -m pip install aiohttp --break-system-packages
sudo python3 -m pip install paho-mqtt --break-system-packages
sudo apt install -y python3-eventlet
sudo python3 -m pip install msgpack --break-system-packages
sudo python3 -m pip install eventlet --break-system-packages
sudo python3 -m pip install psycopg2-binary --break-system-packages
sudo python3 -m pip install python-dotenv --break-system-packages
. ~/.bashrc
""",True,"Minimum Install"))

# fissure Commands
programs_dragonOS_noble.append(('fissure Commands (20.00 kB)',
f"""# Detect environment and choose bin path
if [ -n "$APPTAINER_CONTAINER" ] || [ -n "$APPTAINER_NAME" ]; then
  echo "[Apptainer detected] Using /usr/local/bin for command installs."
  bin_path="/usr/local/bin"
else
  bin_path="$HOME/.local/bin"
fi

echo "Using bin path: $bin_path"
mkdir -p "$bin_path"

# Add ~/.local/bin to PATH if missing (for normal installs)
if [ "$bin_path" = "$HOME/.local/bin" ]; then
  if grep -Fq "~/.local/bin" ~/.bashrc
  then
    echo "~/.local/bin is already in ~/.bashrc"
  else
    printf "\\n%s\\n" "export PATH=~/.local/bin:$PATH" >> ~/.bashrc
  fi
fi

# Create fissure command
cat << EOF > "$bin_path/fissure"
#!/bin/bash
export PYTHONPATH="$PYTHONPATH:{fissure_directory}"
cd {fissure_directory} || exit 1
exec python3 fissure/Dashboard/__main__.py
EOF
chmod +x "$bin_path/fissure"

# Create fissure-sensor-node command
cat << EOF > "$bin_path/fissure-sensor-node"
#!/bin/bash
export PYTHONPATH="$PYTHONPATH:{fissure_directory}"
cd {fissure_directory} || exit 1
exec python3 fissure/Sensor_Node/SensorNode.py
EOF
chmod +x "$bin_path/fissure-sensor-node"

# Create fissure-hiprfisr command
cat << EOF > "$bin_path/fissure-hiprfisr"
#!/bin/bash
export PYTHONPATH="$PYTHONPATH:{fissure_directory}"
cd {fissure_directory} || exit 1
exec python3 fissure/Server/__main__.py --remote
EOF
chmod +x "$bin_path/fissure-hiprfisr"

# Create desktop entry for FISSURE (skip in Apptainer)
if [ -z "$APPTAINER_CONTAINER" ] && [ -z "$APPTAINER_NAME" ]; then
  echo "[Desktop Entry]\\nStartupWMClass=__main__.py\\nName=FISSURE\\nTerminal=false\\nType=Application\\nCategories=Qt;Science;DataVisualization;Electricity;HamRadio;" > {fissure_directory}/Installer/fissure.desktop
  echo "Exec=/home/$USER/.local/bin/fissure" >> {fissure_directory}/Installer/fissure.desktop
  echo "Icon={fissure_directory}/docs/Icons/logo_f.png" >> {fissure_directory}/Installer/fissure.desktop
  sudo cp {fissure_directory}/Installer/fissure.desktop /usr/share/applications/ 2>/dev/null || true
else
  echo "[Apptainer detected] Skipping desktop entry creation."
fi

########## Verify ##########
ls -l /usr/local/bin/fissure /usr/local/bin/fissure-sensor-node 2>/dev/null \
  || ls -l ~/.local/bin/fissure ~/.local/bin/fissure-sensor-node
""", True, 'Minimum Install'))

# expect Command Fix
programs_dragonOS_noble.append(('expect Command Fix (0.00 kB)',
"""sudo sed -i 's/lindex $argv 0/lindex $argv/g' """ + fissure_directory + """/Tools/expect_script
""", True, "Minimum Install"))

# Password Prompt Exceptions
programs_dragonOS_noble.append(('Password Prompt Exceptions (8.00 kB)',
f"""# Replace placeholder in the template file directly into a temporary file
sed "s/__USERNAME__/$(whoami)/g" "{fissure_directory}/Installer/password_prompt_exceptions.txt" > /tmp/password_prompt_exceptions

# Validate the temporary sudoers file
echo "Validating sudoers file..."
if visudo -c -f /tmp/password_prompt_exceptions; then
    echo "Validation successful. Installing sudoers file..."
    sudo mv /tmp/password_prompt_exceptions /etc/sudoers.d/fissure
    sudo chown root:root /etc/sudoers.d/fissure
    sudo chmod 440 /etc/sudoers.d/fissure
    echo "No Password Prompts Setup completed successfully!"
else
    echo "Validation failed! Not installing the sudoers file to avoid system issues."
    rm /tmp/password_prompt_exceptions
fi
########## Verify ##########
ls -l /etc/sudoers.d/fissure
""", True, 'Minimum Install'))

# # GNU Radio
# programs_dragonOS_noble.append(('GNU Radio (1.40 GB)',
# """sudo add-apt-repository -y ppa:gnuradio/gnuradio-releases
# sudo apt-get update
# sudo apt-get install -y gnuradio  # =3.10.5.1-0~gnuradio~jammy-2  # Check for changes here: https://launchpad.net/~gnuradio/+archive/ubuntu/gnuradio-releases
# sudo apt-get install -y uhd-host

# # Configure GNU Radio
# (gnuradio-companion &) && sleep 5 && killall gnuradio-companion
# /bin/echo -e "[grc]\nlocal_blocks_path=""" + fissure_directory + """/Custom_Blocks\nxterm_executable=/usr/bin/gnome-terminal" > ~/.gnuradio/config.conf
# sudo cp /usr/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/  # For B205 mini
# sudo udevadm control --reload-rules
# sudo udevadm trigger
# sudo mkdir /usr/share/uhd
# sudo chmod -R 777 /usr/share/uhd
# uhd_images_downloader

# # Find OOT Modules
# printf "\\n%s\\n" "export PYTHONPATH=/usr/local/lib/python3.8/site-packages:/usr/local/lib/python3/dist-packages:/usr/lib/python3/site-packages:$PYTHONPATH" >> ~/.bashrc
# printf "\\n%s\\n" "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> ~/.bashrc
# printf "\\n%s\\n" "export PYTHONPATH=/usr/local/lib/python3/dist-packages:/usr/lib/python3/site-packages:$PYTHONPATH" >> ~/.profile  # For GRC without terminal
# printf "\\n%s\\n" "export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> ~/.profile  # For GRC without terminal
# . ~/.bashrc
# sudo apt-get install -y libzmq3-dev swig cmake
# sudo sh -c "/bin/echo -e '/usr/local/lib' >> /etc/ld.so.conf"
# sudo ldconfig
# ########## Verify ##########
# gnuradio-companion --help
# """,True,"Minimum Install"))

# Scapy
programs_dragonOS_noble.append(('Scapy (14.74 MB)',
"""sudo apt-get install -y python3-scapy
#sudo python3 -m pip install scapy --break-system-packages  # Causes errors
sudo python2 -m pip install scapy==2.4.5
sudo sed -i 's/tostring/tobytes/g' /usr/local/lib/python3.10/dist-packages/scapy/arch/linux.py
########## Verify ##########
python2 -c "import scapy" && python3 -c "import scapy"
""",True,"Minimum Install"))

# Wireshark
programs_dragonOS_noble.append(('Wireshark (52.00 kB)',
"""#sudo add-apt-repository --y ppa:wireshark-dev/stable  # Gets installed with Misc. Dependencies (tshark), ESP32 Bluetooth Classic Sniffer
# sudo apt-get update
# sudo apt install -y wireshark wireshark-dev  # Yes
# sudo groupadd wireshark
# sudo usermod -a -G wireshark $USER
# sudo chgrp wireshark /usr/bin/dumpcap
# sudo chmod o-rx /usr/bin/dumpcap
# sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap
# sudo getcap /usr/bin/dumpcap
mkdir -p ~/.config/wireshark/plugins
cp -a """ + fissure_directory + """/Dissectors/. ~/.config/wireshark/plugins
########## Verify ##########
wireshark --help
""",True,"Minimum Install"))

# PostgreSQL Database 
programs_dragonOS_noble.append(('PostgreSQL Database (1.46 GB)',
"""sudo python3 -m pip install python-dotenv --break-system-packages
sudo apt-get install -y libpq-dev
sudo python3 -m pip install psycopg2 --break-system-packages
sudo apt-get install -y docker.io docker-compose-v2
sudo usermod -aG docker ${USER}  # Reboot computer to use docker commands without sudo
sudo apt install -y postgresql-client
cd '""" + fissure_directory + """'
cp example.env .env
bash -c '
    set -o allexport
    source .env
    set +o allexport
    export PGPASSWORD=$POSTGRES_PASSWORD
    sudo docker compose up -d
    until pg_isready -U $POSTGRES_USER -h $POSTGRES_HOST -p $POSTGRES_EXTERNAL_PORT; do
        echo "Waiting for PostgreSQL to be ready..."
        sleep 2
    done
    pg_restore -U $POSTGRES_USER -d $POSTGRES_DB -h $POSTGRES_HOST -p $POSTGRES_EXTERNAL_PORT -v db/fissure_db_dump.sql
'
########## Verify ##########
bash -c '
    set -o allexport
    source .env
    set +o allexport
    export PGPASSWORD=$POSTGRES_PASSWORD
    sudo docker compose up -d
    psql -U $POSTGRES_USER -d $POSTGRES_DB -h $POSTGRES_HOST -p $POSTGRES_EXTERNAL_PORT -c "SELECT COUNT(*) FROM pg_tables;"
'
""",True,'Minimum Install'))

# Meshtastic
programs_dragonOS_noble.append(('Meshtastic (15.35 MB)',
"""sudo apt-get install -y python3-serial
sudo apt-get install -y python3-protobuf
sudo apt-get install -y python3-pyserial
sudo python3 -m pip install meshtastic --break-system-packages
sudo usermod -aG dialout $USER  # log out & in/reboot
sudo usermod -aG tty $USER
echo 'SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0666"' | sudo tee /etc/udev/rules.d/99-meshtastic.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
########## Verify ##########
python3 -c "import meshtastic"
""",True,'Minimum Install'))

# Network Certificates 
programs_dragonOS_noble.append(('Network Certificates  (4.40 MB)',
"""cd '""" + fissure_directory + """'
export PYTHONPATH='""" + fissure_directory + """':$PYTHONPATH
python3 ./fissure/generate_certificates.py
########## Verify ##########
ls '""" + fissure_directory + """/certificates'
""",True,'Minimum Install'))

# Auto-Launch Sensor Node
programs_dragonOS_noble.append(('Auto-Launch Sensor Node',
f"""mkdir -p "$HOME/.config/autostart"

cat <<EOF > "$HOME/.config/autostart/fissure-sensor-node.desktop"
[Desktop Entry]
Type=Application
Terminal=true
Name=FISSURE Sensor Node
Exec=gnome-terminal -- bash -c 'sleep 1; $HOME/.local/bin/fissure-sensor-node; exec bash'
EOF

chmod +x "$HOME/.config/autostart/fissure-sensor-node.desktop"

########## Verify ##########
ls "$HOME/.config/autostart/fissure-sensor-node.desktop"
""",False,'Remote Sensor Node'))

# # LimeSDR
# programs_dragonOS_noble.append(('LimeSDR',
# """#sudo add-apt-repository -y ppa:myriadrf/drivers  # doesn't work
# #sudo apt-get update
# sudo apt-get install -y limesuite liblimesuite-dev limesuite-udev  # No limesuite-images on 22.04
# sudo apt-get install -y soapysdr-tools soapysdr-module-lms7
# sudo apt-get install -y libboost-all-dev swig
# ########## Verify ##########
# ls /usr/bin/LimeSuiteGUI
# """,True,'Hardware'))

# # BladeRF
# programs_dragonOS_noble.append(('BladeRF',
# """sudo apt-get install -y libusb-1.0-0-dev libusb-1.0-0 build-essential cmake libncurses5-dev libtecla1 pkg-config git wget  # no package: libtecla1-dev       
# sudo apt-get install -y bladerf
# sudo apt-get install -y bladerf-fpga-hostedx115
# sudo apt-get install -y bladerf-fpga-hostedx40
# sudo apt-get install -y bladerf-fpga-hostedxa4
# sudo apt-get install -y bladerf-fpga-hostedxa9
# ########## Verify ##########
# bladeRF-cli --help
# """,True,'Hardware'))

# USRP X300 Series
programs_dragonOS_noble.append(('USRP X300 Series (0.00 kB)',
"""mkdir -p ~/Installed_by_FISSURE  # Set MTU to 9000 and run uhd_image_loader command
cd ~/Installed_by_FISSURE
#wget https://codeload.github.com/EttusResearch/uhd/zip/release_003_010_003_000 -O uhd.zip
#unzip uhd.zip
#cd uhd-release_003_010_003_000/host/include
#sudo cp -Rv uhd/rfnoc /usr/share/uhd/
#rm -Rf ~/Installed_by_FISSURE/uhd-release_003_010_003_000
/usr/lib/uhd/utils/uhd_images_downloader.py
#"/usr/bin/uhd_image_loader" --args="type=x300,addr=192.168.40.2"  # Use your X310 IP
sudo sysctl -w net.core.wmem_max=24862979
""",True,'Hardware'))

# # HackRF, gr-osmosdr
# programs_dragonOS_noble.append(('HackRF, gr-osmosdr (73.12 MB)',
# """sudo apt-get install -y libusb-1.0-0-dev

# # HackRF
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE/
# wget https://github.com/greatscottgadgets/hackrf/releases/download/v2024.02.1/hackrf-2024.02.1.zip
# unzip hackrf-2024.02.1.zip
# rm hackrf-2024.02.1.zip
# mkdir ~/Installed_by_FISSURE/hackrf-2024.02.1/host/build
# cd ~/Installed_by_FISSURE/hackrf-2024.02.1/host/build
# sed -i 's/cmake_minimum_required(VERSION 2.8.12)/cmake_minimum_required(VERSION 3.5)/' \
#     ~/Installed_by_FISSURE/hackrf-2024.02.1/host/CMakeLists.txt \
#     ~/Installed_by_FISSURE/hackrf-2024.02.1/host/libhackrf/CMakeLists.txt \
#     ~/Installed_by_FISSURE/hackrf-2024.02.1/host/hackrf-tools/CMakeLists.txt
# cmake ..
# make
# sudo make install
# sudo ldconfig
# sudo cp """ + fissure_directory + """/Tools/53-hackrf.rules /etc/udev/rules.d/53-hackrf.rules
# sudo udevadm trigger --action=change
# #sudo apt-get install -y hackrf

# # gr-osmosdr
# #sudo apt-get install gr-osmosdr
# cd ~/Installed_by_FISSURE
# git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git
# cd gr-osmosdr
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# sudo ldconfig
# ########## Verify ##########
# hackrf_sweep -h #&& ls /usr/local/bin/osmocom_fft
# """,True,'Hardware'))

# 8812au Driver
programs_dragonOS_noble.append(('8812au Driver (202.46 MB)',
"""sudo apt-get -y install dkms
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/aircrack-ng/rtl8812au/
cd ~/Installed_by_FISSURE/rtl8812au
sudo make dkms_install
""",True,'Hardware'))

# Zigbee Sniffer
programs_dragonOS_noble.append(('Zigbee Sniffer (124.00 kB)',
"""mkdir -p ~/Installed_by_FISSURE
cp -R """ + fissure_directory + """/Tools/OpenSniffer-0.1/ ~/Installed_by_FISSURE/
cd ~/Installed_by_FISSURE/OpenSniffer-0.1/
sudo python3 setup.py install
#sudo add-apt-repository -y ppa:rock-core/qt4  # PyQt4, doesn't work
#sudo apt-get update
wget http://archive.ubuntu.com/ubuntu/pool/universe/q/qt-assistant-compat/libqtassistantclient4_4.6.3-7build1_amd64.deb -O ~/Downloads/libqtassistantclient4_4.6.3-7build1_amd64.deb 
sudo apt-get install -y ~/Downloads/libqtassistantclient4_4.6.3-7build1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/python-qt4/python-qt4_4.12.1+dfsg-2_amd64.deb -O ~/Downloads/python-qt4_4.12.1+dfsg-2_amd64.deb
sudo apt-get install -y ~/Downloads/python-qt4_4.12.1+dfsg-2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pyaudio/python-pyaudio_0.2.11-1build2_amd64.deb -O ~/Downloads/python-pyaudio_0.2.11-1build2_amd64.deb
sudo apt-get install -y ~/Downloads/python-pyaudio_0.2.11-1build2_amd64.deb
rm ~/Downloads/libqtassistantclient4_4.6.3-7build1_amd64.deb
rm ~/Downloads/python-qt4_4.12.1+dfsg-2_amd64.deb
rm ~/Downloads/python-pyaudio_0.2.11-1build2_amd64.deb
sudo apt-get install -y mlocate
""",True,'Hardware'))

# fl2k
programs_dragonOS_noble.append(('fl2k',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://gitea.osmocom.org/sdr/osmo-fl2k.git  # gets redirected: https://git.osmocom.org/osmo-fl2k.git
cd osmo-fl2k
mkdir build
cd build
sed -i 's/cmake_minimum_required(VERSION 2.6)/cmake_minimum_required(VERSION 3.5)/' ~/Installed_by_FISSURE/osmo-fl2k/CMakeLists.txt
cmake ../ -DINSTALL_UDEV_RULES=ON
make -j 3
sudo make install
sudo ldconfig
sudo udevadm control -R
sudo udevadm trigger
########## Verify ##########
ls /usr/local/bin/fl2k_test
""",True,'Hardware'))

# Proxmark3
programs_dragonOS_noble.append(('Proxmark3 (3.52 GB)',
"""sudo apt-get install -y p7zip git build-essential libreadline8 libreadline-dev libusb-0.1-4 libusb-dev perl pkg-config wget libncurses5-dev gcc-arm-none-eabi libreadline-dev libpcsclite-dev gcc-arm-none-eabi
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/Proxmark/proxmark3.git
cd proxmark3
make clean && make all
########## Verify ##########
ls ~/Installed_by_FISSURE/proxmark3/client/proxmark3
""",True,'Hardware'))

# # PlutoSDR
# programs_dragonOS_noble.append(('PlutoSDR',
# """sudo apt-get install -y libglib2.0-dev libgtk2.0-dev libgtkdatabox-dev libmatio-dev libfftw3-dev libxml2 libxml2-dev bison flex libavahi-common-dev libavahi-client-dev libcurl4-openssl-dev libjansson-dev cmake libaio-dev libserialport-dev libcdk5-dev libusb-1.0-0-dev doxygen graphviz git libgmp-dev swig liborc-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://github.com/pcercuei/libini.git
# cd libini
# sed -i 's/cmake_minimum_required(VERSION 3.1.0)/cmake_minimum_required(VERSION 3.5)/' ~/Installed_by_FISSURE/libini/CMakeLists.txt
# mkdir build
# cd build
# cmake ../
# make
# sudo make install
# sudo ldconfig
# cd ~/Installed_by_FISSURE
# git clone https://github.com/analogdevicesinc/libiio.git -b v0.23
# cd libiio
# sed -i 's/cmake_minimum_required(VERSION 2.8.7)/cmake_minimum_required(VERSION 3.5)/' \
#     ~/Installed_by_FISSURE/libiio/iiod/CMakeLists.txt \
#     ~/Installed_by_FISSURE/libiio/tests/CMakeLists.txt \
#     ~/Installed_by_FISSURE/libiio/CMakeLists.txt
# mkdir build && cd build 
# cmake ../ 
# make 
# sudo make install
# sudo ldconfig
# cd ~/Installed_by_FISSURE
# git clone https://github.com/analogdevicesinc/libad9361-iio.git
# cd libad9361-iio
# git checkout libad9361-iio-v0
# sed -i 's/cmake_minimum_required(VERSION 2.8.12)/cmake_minimum_required(VERSION 3.5)/' ~/Installed_by_FISSURE/libad9361-iio/CMakeLists.txt
# mkdir build && cd build
# cmake .. -DLIBIIO_INCLUDEDIR=/usr/local/include
# make -j$(nproc)
# sudo make install
# sudo ldconfig

# #cd ~/Installed_by_FISSURE
# #git clone https://github.com/analogdevicesinc/iio-oscilloscope.git  # IIO oscilloscope is broken. /usr/include/gtkdatabox_graph.h:100:38: error: unknown type name ‘GdkRGBA’; did you mean ‘GdkGC’?
# #cd iio-oscilloscope
# #git checkout origin/master
# #mkdir build && cd build
# #cmake ../ && make
# #sudo make install
# #cd ~/Installed_by_FISSURE
# #git clone -b upgrade-3.8 https://github.com/analogdevicesinc/gr-iio.git  # No Github version for 3.10. Comes with GNU Radio 3.10.
# #cd gr-iio
# #cmake .
# #make
# #sudo make install
# #cd ..
# #sudo ldconfig
# ########## Verify ##########
# ls /usr/lib/python*/*/gnuradio/iio
# """,True,'Hardware'))

# qFlipper
programs_dragonOS_noble.append(('qFlipper (26.40 MB)',
"""mkdir -p ~/Installed_by_FISSURE/qFlipper
cd ~/Installed_by_FISSURE/qFlipper
wget -r -np -nd -A "qFlipper-x86_64-dev*.AppImage" https://update.flipperzero.one/builds/qFlipper/dev/
chmod +x qFlipper*
########## Verify ##########
ls ~/Installed_by_FISSURE/qFlipper/qFlipper*
""",True,'Hardware'))

# gr-acars-3.10ng
programs_dragonOS_noble.append(('gr-acars-3.10ng (4.94 MB)',
"""cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-acars-3.10ng/
sudo rm -Rf build
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig
########## Verify ##########
ls /usr/local/lib/python*/*/acars
""",True,'Out-of-Tree Modules'))

# gr-adsb
programs_dragonOS_noble.append(('gr-adsb (4.44 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-adsb/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-adsb"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-adsb/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-adsb/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-adsb/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/adsb
""",True,'Out-of-Tree Modules'))

# gr-ainfosec
programs_dragonOS_noble.append(('gr-ainfosec (5.13 MB)',
"""cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ainfosec/
sudo rm -Rf build
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/ainfosec
""",True,'Minimum Install'))

# gr-ais
programs_dragonOS_noble.append(('gr-ais (9.48 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-ais/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-ais"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ais/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ais/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ais/
  sed -i 's/VERSION 3.8/VERSION 3.10/g' ./CMakeLists.txt
  sed '/project(gr-ais CXX C)/a\set(CMAKE_CXX_STANDARD 17)' ./CMakeLists.txt
  sed -i 's/add_compile_options(-std=c++11)/set(CMAKE_CXX_STANDARD_REQUIRED ON)/g' ./CMakeLists.txt
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/ais
""",True,'Out-of-Tree Modules'))

# gr-aistx
programs_dragonOS_noble.append(('gr-aistx (15.60 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/ais/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/ais"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/ais/gr-aistx/
    git checkout gnuradio-3.10-port-udp
    git pull origin gnuradio-3.10-port-udp
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/ais/gr-aistx/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/ais/gr-aistx/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/aistx
""",True,'Out-of-Tree Modules'))

# gr-bluetooth
programs_dragonOS_noble.append(('gr-bluetooth',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-bluetooth/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-bluetooth"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-bluetooth/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-bluetooth/)" ]; 
then
  mkdir -p ~/Installed_by_FISSURE
  cd ~/Installed_by_FISSURE
  rm -Rf libbtbb
  git clone https://github.com/greatscottgadgets/libbtbb -b master
  cd libbtbb
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-bluetooth/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/bin/btrx
""",False,'Out-of-Tree Modules'))

# gr-clapper_plus
programs_dragonOS_noble.append(('gr-clapper_plus (7.73 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-clapper_plus/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-clapper_plus"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-clapper_plus/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-clapper_plus/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-clapper_plus/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/clapper_plus
""",True,'Out-of-Tree Modules'))

# gr-dect2
programs_dragonOS_noble.append(('gr-dect2 (9.97 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-dect2/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-dect2"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-dect2/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-dect2/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-dect2/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/dect2
""",True,'Out-of-Tree Modules'))

# gr-foo
programs_dragonOS_noble.append(('gr-foo (22.18 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-foo/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-foo"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-foo/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-foo/)" ]; 
then
  sudo apt-get install -y libsndfile1-dev
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-foo/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/foo
""",True,'Out-of-Tree Modules'))

# gr-fuzzer
programs_dragonOS_noble.append(('gr-fuzzer (5.10 MB)',
"""cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-fuzzer/
sudo rm -Rf build
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/fuzzer
""",True,'Out-of-Tree Modules'))

# gr-garage_door
programs_dragonOS_noble.append(('gr-garage_door (5.34 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-garage_door/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-garage_door"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-garage_door/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-garage_door/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-garage_door/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/garage_door
""",True,'Out-of-Tree Modules'))

# # gr-gsm
# programs_dragonOS_noble.append(('gr-gsm',
# """cd """ + fissure_directory + """
# if [ ! -f "Custom_Blocks/maint-3.10/gr-gsm/.git" ]; then
#     git submodule update --init -- "Custom_Blocks/maint-3.10/gr-gsm"
#     cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-gsm/
#     git checkout maint-3.10
#     git pull origin maint-3.10
# fi
# if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-gsm/)" ]; 
# then
#   cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-gsm/
#   sudo rm -Rf build
#   sudo apt-get install -y gr-osmosdr
#   mkdir build
#   cd build
#   cmake ..
#   make
#   sudo make install
#   sudo ldconfig
#   # gr-gsm needs to be made twice for "import arfcn" block to work
#   make 
#   sudo make install
#   sudo ldconfig
# else
#   echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
# fi
# ########## Verify ##########
# ls /usr/local/lib/python*/*/gnuradio/gsm
# """,True,'Out-of-Tree Modules'))

# # gr-ieee802-11
# programs_dragonOS_noble.append(('gr-ieee802-11',
# """cd """ + fissure_directory + """
# if [ ! -f "Custom_Blocks/maint-3.10/gr-ieee802-11/.git" ]; then
#     git submodule update --init -- "Custom_Blocks/maint-3.10/gr-ieee802-11"
#     cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-11/
#     git checkout maint-3.10
#     git pull origin maint-3.10
# fi
# if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-11/)" ]; 
# then
#   sudo apt-get install -y libsndfile1-dev
#   cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-11/
#   sudo rm -Rf build
#   mkdir build
#   cd build
#   cmake ..
#   make
#   sudo make install
#   sudo ldconfig
# else
#   echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
# fi
# ########## Verify ##########
# ls /usr/local/lib/python*/*/ieee802_11
# """,True,'Out-of-Tree Modules'))

# gr-ieee802-15-4
programs_dragonOS_noble.append(('gr-ieee802-15-4 (54.02 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-ieee802-15-4/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-ieee802-15-4"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-15-4/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-15-4/)" ]; 
then
  sudo apt-get install -y libsndfile1-dev
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-15-4/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
  grcc """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-15-4/examples/ieee802_15_4_CSS_PHY.grc
  grcc """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-ieee802-15-4/examples/ieee802_15_4_OQPSK_PHY.grc
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/ieee802_15_4
""",True,'Out-of-Tree Modules'))

# gr-iridium
programs_dragonOS_noble.append(('gr-iridium (44.19 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-iridium/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-iridium"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-iridium/
    git checkout master
    git pull origin master
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-iridium/)" ]; 
then
  sudo apt-get install -y libsndfile1-dev
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-iridium/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/iridium
""",True,'Out-of-Tree Modules'))

# gr-j2497
programs_dragonOS_noble.append(('gr-j2497 (5.80 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-j2497/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-j2497"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-j2497/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-j2497/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-j2497/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/j2497
""",True,'Out-of-Tree Modules'))

# # gr-limesdr
# programs_dragonOS_noble.append(('gr-limesdr',
# """cd """ + fissure_directory + """
# if [ ! -f "Custom_Blocks/maint-3.10/gr-limesdr/.git" ]; then
#     git submodule update --init -- "Custom_Blocks/maint-3.10/gr-limesdr"
#     cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-limesdr/
#     git checkout maint-3.10
#     git pull origin maint-3.10
# fi
# if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-limesdr/)" ]; 
# then
#   cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-limesdr/
#   sudo rm -Rf build
#   mkdir build
#   cd build
#   cmake ..
#   make
#   sudo make install
#   sudo ldconfig
# else
#   echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
# fi
# ########## Verify ##########
# ls /usr/local/lib/python*/*/gnuradio/limesdr
# """,True,'Out-of-Tree Modules'))

# gr-mixalot
programs_dragonOS_noble.append(('gr-mixalot (49.39 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-mixalot/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-mixalot"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-mixalot/
    git checkout main
    git pull origin main
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-mixalot/)" ]; 
then
  sudo apt-get install -y libitpp-dev
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-mixalot/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/mixalot
""",True,'Out-of-Tree Modules'))

# gr-nrsc5
programs_dragonOS_noble.append(('gr-nrsc5 (55.45 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-nrsc5/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-nrsc5"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-nrsc5/
    git checkout master
    git pull origin master
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-nrsc5/)" ]; 
then
  sudo apt-get install -y libsndfile1-dev
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-nrsc5/
  sudo rm -Rf build
  sudo apt install -y git build-essential cmake autoconf libtool libao-dev libfftw3-dev librtlsdr-dev libgsl-dev
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/nrsc5
""",True,'Out-of-Tree Modules'))

# gr-paint
programs_dragonOS_noble.append(('gr-paint (17.54 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-paint/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-paint"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-paint/
    git checkout master
    git pull origin master
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-paint/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-paint/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-paint/
  gcc tgatoluma.c -o tgatoluma
  chmod +x tgatoluma
  cp tgatoluma ~/.local/bin/
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/paint
""",True,'Out-of-Tree Modules'))

# gr-rds
programs_dragonOS_noble.append(('gr-rds (21.93 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-rds/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-rds"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-rds/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-rds/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-rds/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/rds
""",True,'Out-of-Tree Modules'))

# gr-sidekiq
programs_dragonOS_noble.append(('gr-sidekiq',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-sidekiq/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-sidekiq"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-sidekiq/
    git checkout master
    git pull origin master
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-sidekiq/)" ];  # Requires Sidekiq SDK files before building.
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-sidekiq/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/*/sidekiq
""",False,'Out-of-Tree Modules'))

# gr-sdrplay3
programs_dragonOS_noble.append(('gr-sdrplay3 (24.12 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-sdrplay3/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-sdrplay3"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-sdrplay3/
    git checkout main
    git pull origin main
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-sdrplay3/)" ];  # Requires SDRplay API before building: https://www.sdrplay.com/api
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-sdrplay3/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/*/sdrplay3
""",True,'Out-of-Tree Modules'))

# gr-tpms
programs_dragonOS_noble.append(('gr-tpms (10.49 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-tpms/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-tpms"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-tpms/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-tpms/)" ]; 
then
  sudo apt-get install -y libsndfile1-dev
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-tpms/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/tpms
""",True,'Out-of-Tree Modules'))

# gr-tpms_poore
programs_dragonOS_noble.append(('gr-tpms_poore (10.86 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-tpms_poore/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-tpms_poore"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-tpms_poore/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-tpms_poore/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-tpms_poore/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/tpms_poore
""",True,'Out-of-Tree Modules'))

# gr-X10
programs_dragonOS_noble.append(('gr-X10 (7.89 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-X10/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-X10"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-X10/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-X10/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-X10/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/X10
""",True,'Out-of-Tree Modules'))

# gr-zwave_poore
programs_dragonOS_noble.append(('gr-zwave_poore (6.85 MB)',
"""cd """ + fissure_directory + """
if [ ! -f "Custom_Blocks/maint-3.10/gr-zwave_poore/.git" ]; then
    git submodule update --init -- "Custom_Blocks/maint-3.10/gr-zwave_poore"
    cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-zwave_poore/
    git checkout maint-3.10
    git pull origin maint-3.10
fi
if [ "$(ls -A """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-zwave_poore/)" ]; 
then
  cd """ + fissure_directory + """/Custom_Blocks/maint-3.10/gr-zwave_poore/
  sudo rm -Rf build
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  sudo ldconfig
else
  echo "Folder is empty. Execute 'git submodule update --init' from FISSURE directory."
fi
########## Verify ##########
ls /usr/local/lib/python*/*/gnuradio/zwave_poore
""",True,'Out-of-Tree Modules'))

# QSpectrumAnalyzer
programs_dragonOS_noble.append(('QSpectrumAnalyzer (2.89 MB)',
"""#sudo add-apt-repository -y ppa:myriadrf/drivers
#sudo apt-get -y update
sudo apt-get install -y python3-pip python3-pyqt5 python3-numpy python3-scipy python3-soapysdr  # No package: soapysdr
sudo apt-get install -y soapysdr-module-rtlsdr soapysdr-module-airspy soapysdr-module-hackrf soapysdr-module-lms7
python3 -m pip install --user qspectrumanalyzer --break-system-packages  # log in again, run without sudo
########## Verify ##########
ls ~/.local/bin/qspectrumanalyzer
""",True,'SDR'))

# # GQRX
# programs_dragonOS_noble.append(('GQRX',
# """sudo apt-get install -y libqt5svg5-dev  #sudo apt-get install -y gqrx-sdr
# sudo apt-get install -y libpulse-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE/
# git clone https://github.com/gqrx-sdr/gqrx.git
# cd  ~/Installed_by_FISSURE/gqrx
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# ########## Verify ##########
# ls /usr/local/bin/gqrx
# """,True,'SDR'))

# # Dump1090
# programs_dragonOS_noble.append(('Dump1090',
# """sudo apt-get install -y libusb-1.0-0-dev
# sudo apt-get install -y librtlsdr-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE/
# git clone https://github.com/antirez/dump1090.git
# cd ~/Installed_by_FISSURE/dump1090/
# make
# ########## Verify ##########
# ~/Installed_by_FISSURE/dump1090/dump1090 --help
# """,True,'Aircraft'))

# # QtDesigner
# programs_dragonOS_noble.append(('QtDesigner',
# """sudo apt-get install -y qtcreator
# sudo apt-get install -y qtbase5-dev 
# sudo apt-get install -y qtchooser 
# sudo apt-get install -y qt5-qmake
# sudo apt-get install -y qttools5-dev-tools  # Does not have qtbase5-dev-tools
# ########## Verify ##########
# ls /usr/bin/designer
# """,True,'Development'))

# Grip
programs_dragonOS_noble.append(('Grip (1.02 MB)',
"""sudo python3 -m pip install grip --break-system-packages
########## Verify ##########
ls /usr/local/bin/grip
""",True,'Development'))

# # Kismet
# programs_dragonOS_noble.append(('Kismet',
# """wget -O - https://www.kismetwireless.net/repos/kismet-release.gpg.key | sudo apt-key add -
# echo 'deb https://www.kismetwireless.net/repos/apt/release/jammy jammy main' | sudo tee /etc/apt/sources.list.d/kismet.list
# sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d  # Removes "sudo apt update" warnings
# sudo apt update
# echo "kismet kismet/install-setuid boolean false" | sudo debconf-set-selections
# echo "kismet kismet/install-user string kismet" | sudo debconf-set-selections
# sudo DEBIAN_FRONTEND=noninteractive apt-get install -y kismet
# """,True,'802.11'))

# UDP Replay
programs_dragonOS_noble.append(('UDP Replay (692.00 kB)',
"""sudo apt-get install -y libpcap-dev
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/rigtorp/udpreplay.git
cd ~/Installed_by_FISSURE/udpreplay
mkdir build
cd build
cmake ..
make
sudo make install
########## Verify ##########
ls /usr/local/bin/udpreplay
""",True,'802.11'))

# V2Verifier
programs_dragonOS_noble.append(('V2Verifier (2.08 MB)',
"""sudo apt-get install -y libgmp3-dev python3-tk python3-pil.imagetk
sudo python3 -m pip install fastecdsa --break-system-packages
sudo python3 -m pip install -U pyyaml --break-system-packages
#sudo apt install -y git cmake libuhd-dev uhd-host swig libgmp3-dev python3-pip python3-tk python3-pil 
#python3-pil.imagetk gnuradio
#Needs gr-foo and gr-ieee802-11
""",True,'V2V'))

# # srsRAN_4G/srsRAN/srsLTE
# programs_dragonOS_noble.append(('srsRAN_4G',
# """sudo apt-get install -y build-essential cmake net-tools libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev gcc-11 g++-11
# sudo apt-get install -y libboost-system-dev libboost-test-dev libboost-thread-dev libqwt-qt5-dev qtbase5-dev  # srsGUI
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://github.com/srsLTE/srsGUI.git
# cd srsGUI
# mkdir build
# cd build
# export CC=$(which gcc-11)
# export CXX=$(which g++-11)
# cmake ..
# make
# sudo make install
# cd ~/Installed_by_FISSURE
# git clone https://github.com/srsRAN/srsRAN_4G.git
# cp """ + fissure_directory + """/Tools/IMSI-Catcher_4G/cell_search.c ~/Installed_by_FISSURE/srsRAN_4G/lib/examples/  # IMSI-Catcher 4G
# cd srsRAN_4G/
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# sudo ldconfig
# sudo srsran_install_configs.sh user  # user or service, not username
# cd ../..
# mkdir -p ~/.config/srsran
# sudo cp -f """ + fissure_directory + """/Tools/srsRAN_configs/* ~/.config/srsran/
# sudo chown -R $USER:$USER ~/.config/srsran     # IMSI-Catcher 4G
# sudo apt-get install -y fortune cowsay lolcat  # IMSI-Catcher 4G
# # cd srsRAN/srsepc
# # interface=$(route | awk '/default/ {print $0}' | awk 'END {print $(NF)}')
# # sudo ./srsepc_if_masq.sh "$interface"
# # gnome-terminal --tab --title="srsEPC" -- /bin/sh -c 'sudo srsepc; $SHELL' 
# # gnome-terminal --tab --title="srsENB" -- /bin/sh -c 'sudo srsenb; $SHELL'
# ########## Verify ##########
# srsenb --help
# """,True,'LTE'))

# # FALCON - FIX (needs older soapysdr version?)
# programs_dragonOS_noble.append(('FALCON',
# """sudo apt-get install -y build-essential git cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev  # For srsLTE
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# sudo apt-get install -y libglib2.0-dev libudev-dev libcurl4-gnutls-dev libboost-all-dev qtdeclarative5-dev libqt5charts5-dev  # FALCON
# git clone https://github.com/falkenber9/falcon.git
# cd falcon
# mkdir build
# cd build
# cmake -DFORCE_SUBPROJECT_SRSLTE=ON -DCMAKE_INSTALL_PREFIX=/usr ../
# make
# sudo make install
# #sudo xargs rm < install_manifest.txt  # uninstall
# #make clean
# ########## Verify ##########
# ls /usr/bin/FalconGUI
# """,False,'LTE'))

# LTE-ciphercheck - Fix
programs_dragonOS_noble.append(('LTE-ciphercheck',
"""sudo apt install -y git cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev libuhd-dev libpcsclite-dev pcsc-tools pcscd
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/mrlnc/LTE-ciphercheck  # No 22.04 version yet.
cd LTE-ciphercheck
mkdir build 
cd build
cmake ..
make srsue
sudo ldconfig
cp """ + fissure_directory + """/Tools/LTE-ciphercheck/ciphercheck.conf ../srsue/ciphercheck.conf 
""",False,'LTE'))

# # Aircrack-ng
# programs_dragonOS_noble.append(('Aircrack-ng',
# """sudo apt-get install -y aircrack-ng
# ########## Verify ##########
# aircrack-ng --help
# """,True,'802.11'))

# Geany
programs_dragonOS_noble.append(('Geany (17.31 MB)',
"""sudo apt-get install -y geany
########## Verify ##########
geany --help
""",True,'Development'))

# Arduino IDE
programs_dragonOS_noble.append(('Arduino IDE (600.91 MB)',
"""wget -P ~/Installed_by_FISSURE/ https://downloads.arduino.cc/arduino-1.8.15-linux64.tar.xz
cd ~/Installed_by_FISSURE
tar -xf arduino-1.8.15-linux64.tar.xz
rm arduino-1.8.15-linux64.tar.xz
cd arduino-1.8.15/
sudo ./install.sh
cp -R """ + fissure_directory + """/Tools/Esp8266_listen_trigger/ ~/Installed_by_FISSURE/
########## Verify ##########
arduino --version
""",True,'Development'))

# Minicom
programs_dragonOS_noble.append(('Minicom (1.65 MB)',
"""sudo apt-get install -y minicom
########## Verify ##########
ls /usr/bin/minicom
""",True,'Hardware'))

# PuTTY
programs_dragonOS_noble.append(('PuTTY (6.64 MB)',
"""sudo apt-get install -y putty
########## Verify ##########
putty --help
""",True,'Hardware'))

# openHAB - FIX
programs_dragonOS_noble.append(('openHAB (610.36 MB)',
"""sudo apt-get -yq install gnupg curl
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
cd ~/Downloads
curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-2_all.deb
sudo apt-get install ./zulu-repo_1.0.0-2_all.deb
sudo apt-get update
sudo apt-get install -y zulu11-jdk
rm zulu-repo_1.0.0-2_all.deb
wget -qO - 'https://openhab.jfrog.io/artifactory/api/gpg/key/public' | sudo apt-key add -
sudo apt-get install -y apt-transport-https
echo 'deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main' | sudo tee /etc/apt/sources.list.d/openhab.list
sudo apt-get update 
sudo apt-get install -y openhab
########## Verify ##########
ls /usr/bin/openhab-cli
""",True,'Z-Wave'))

# rtl-zwave
programs_dragonOS_noble.append(('rtl-zwave (112.00 kB)',
"""mkdir -p ~/Installed_by_FISSURE
sudo apt-get install -y libpcap-dev
cp -R """ + fissure_directory + """/Tools/rtl-zwave-master ~/Installed_by_FISSURE/
cd ~/Installed_by_FISSURE/rtl-zwave-master
make
########## Verify ##########
ls ~/Installed_by_FISSURE/rtl-zwave-master/rtl_zwave
""",True,'Z-Wave'))

# waving-z
programs_dragonOS_noble.append(('waving-z (2.12 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE/
git clone https://github.com/baol/waving-z.git
cd ~/Installed_by_FISSURE/waving-z
mkdir build
cd build
sed -i -E 's/^cmake_minimum_required\s*\(\s*VERSION\s+3\.[0-4](\.[0-9]+)?\s*\)/cmake_minimum_required(VERSION 3.5)/' ~/Installed_by_FISSURE/waving-z/CMakeLists.txt
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
########## Verify ##########
ls ~/Installed_by_FISSURE/waving-z/build/wave-in
""",True,'Z-Wave'))

# baudline
programs_dragonOS_noble.append(('baudline',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
wget -P ~/Installed_by_FISSURE/ https://www.baudline.com/baudline_1.08_linux_x86_64.tar.gz  # They removed this file. We are not allowed to distribute source.
tar -xf baudline_1.08_linux_x86_64.tar.gz
rm baudline_1.08_linux_x86_64.tar.gz
########## Verify ##########
~/Installed_by_FISSURE/baudline_1.08_linux_x86_64/baudline --help
""",False,'SDR'))

# # Universal Radio Hacker
# programs_dragonOS_noble.append(('Universal Radio Hacker',
# """sudo python3 -m pip install cython --break-system-packages
# sudo python3 -m pip install urh --break-system-packages
# ########## Verify ##########
# urh --version
# """,True,'SDR'))

# # Inspectrum
# programs_dragonOS_noble.append(('Inspectrum',
# """sudo apt-get install -y inspectrum
# ########## Verify ##########
# inspectrum --help
# """,True,'SDR'))

# OpenCPN
programs_dragonOS_noble.append(('OpenCPN (161.47 MB)',
"""sudo add-apt-repository -y ppa:opencpn/opencpn
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C865EB40  # FIX
sudo apt-get update
sudo apt-get install -y opencpn
########## Verify ##########
ls /usr/bin/opencpn
""",True,'AIS'))

# Kalibrate
programs_dragonOS_noble.append(('Kalibrate (1.97 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/steve-m/kalibrate-rtl.git
cd kalibrate-rtl
./bootstrap && CXXFLAGS='-W -Wall -O3' ./configure && make
########## Verify ##########
ls ~/Installed_by_FISSURE/kalibrate-rtl/src/kal
""",True,'GSM'))

# retrogram-rtlsdr
programs_dragonOS_noble.append(('retrogram-rtlsdr (1.62 MB)',
"""mkdir -p ~/Installed_by_FISSURE
sudo apt-get install -y librtlsdr-dev libncurses5-dev libboost-program-options-dev
cp -R """ + fissure_directory + """/Tools/retrogram-rtlsdr-master ~/Installed_by_FISSURE/
cd ~/Installed_by_FISSURE/retrogram-rtlsdr-master
make
########## Verify ##########
ls ~/Installed_by_FISSURE/retrogram-rtlsdr-master/retrogram-rtlsdr
""",True,'SDR'))

# RTLSDR-Airband
programs_dragonOS_noble.append(('RTLSDR-Airband (7.07 MB)',
"""sudo apt-get install -y build-essential cmake pkg-config libmp3lame-dev libshout3-dev libconfig++-dev libfftw3-dev libpulse-dev
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/szpajder/RTLSDR-Airband.git
cd RTLSDR-Airband
mkdir build
cd build
sed -i -E 's/^[[:space:]]*(cmake_minimum_required|CMAKE_MINIMUM_REQUIRED)[[:space:]]*\([[:space:]]*VERSION[[:space:]]+3\.[0-4]([[:space:]]*)?\)/cmake_minimum_required(VERSION 3.5)/I' ~/Installed_by_FISSURE/RTLSDR-Airband/CMakeLists.txt
cmake ../
make
sudo make install
########## Verify ##########
rtl_airband -h
""",True,'SDR'))

# Spektrum
programs_dragonOS_noble.append(('Spektrum (230.65 MB)',
"""echo 'blacklist dvb_usb_rtl28xxu' | sudo tee /etc/modprobe.d/rtl-sdr.conf  # Restart computer to use RTL device
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="adm", MODE="0666"' | sudo tee /etc/udev/rules.d/20.rtlsdr.rules
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
wget -P ~/Installed_by_FISSURE/ https://github.com/pavels/spektrum/releases/download/2.1.0/spektrum-linux64.tar.gz
tar -xf spektrum-linux64.tar.gz
rm spektrum-linux64.tar.gz
########## Verify ##########
ls ~/Installed_by_FISSURE/spektrum/spektrum
""",True,'SDR'))

# # SDRTrunk
# programs_dragonOS_noble.append(('SDRTrunk',
# """#sudo apt-get -yq install gnupg curl  # Java (if needed)
# #sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
# #cd ~/Downloads
# #curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-2_all.deb
# #sudo apt-get install ./zulu-repo_1.0.0-2_all.deb
# #sudo apt-get update
# #sudo apt-get install -y zulu11-jdk
# #rm zulu-repo_1.0.0-2_all.deb
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# wget -P ~/Installed_by_FISSURE/ https://github.com/DSheirer/sdrtrunk/releases/download/v0.5.0-alpha.6/sdr-trunk-linux-x86_64-v0.5.0-alpha6.zip
# unzip -q sdr-trunk-linux-x86_64-v0.5.0-alpha6.zip
# rm sdr-trunk-linux-x86_64-v0.5.0-alpha6.zip
# ########## Verify ##########
# ls ~/Installed_by_FISSURE/sdr-trunk-linux-x86_64-v0.5.0-alpha6/bin/sdr-trunk
# """,True,'Trunked Radio'))

# Audacity
programs_dragonOS_noble.append(('Audacity (47.15 MB)',
"""sudo apt-get install -y audacity
########## Verify ##########
audacity --version
""",True,'Audio'))

# # Sound eXchange
# programs_dragonOS_noble.append(('Sound eXchange',
# """sudo apt-get install -y sox
# ########## Verify ##########
# sox --version
# """,True,'Audio'))

# # LAME
# programs_dragonOS_noble.append(('LAME',
# """sudo apt-get install -y lame
# ########## Verify ##########
# lame --version
# """,True,'Audio'))

# mpv
programs_dragonOS_noble.append(('mpv (41.89 MB)',
"""sudo apt-get install -y mpv
########## Verify ##########
mpv --version
""",True,'Audio'))

# # FFmpeg
# programs_dragonOS_noble.append(('FFmpeg',
# """sudo apt-get install -y ffmpeg 
# ########## Verify ##########
# ffmpeg --help
# """,True,'Audio'))

# MPlayer
programs_dragonOS_noble.append(('MPlayer (7.80 MB)',
"""sudo apt-get install -y mplayer
########## Verify ##########
ls /usr/bin/mplayer
""",True,'Audio'))

# # VLC
# programs_dragonOS_noble.append(('VLC',
# """sudo apt-get install -y vlc
# ########## Verify ##########
# vlc --help
# """,True,'Video'))

# # Simple Screen Recorder
# programs_dragonOS_noble.append(('Simple Screen Recorder',
# """sudo apt-get install -y simplescreenrecorder
# ########## Verify ##########
# simplescreenrecorder --help
# """,False,'Video'))

# radiosonde_auto_rx
programs_dragonOS_noble.append(('radiosonde_auto_rx (39.20 MB)',
"""sudo apt-get install -y python3 python3-numpy python3-setuptools python3-crcmod python3-requests python3-dateutil python3-pip python3-flask sox git build-essential libtool cmake usbutils libusb-1.0-0-dev rng-tools libsamplerate-dev libatlas3-base libgfortran5
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/projecthorus/radiosonde_auto_rx.git
cd radiosonde_auto_rx/auto_rx
./build.sh
cp station.cfg.example station.cfg
sudo python3 -m pip install -r requirements.txt --break-system-packages
########## Verify ##########
ls ~/Installed_by_FISSURE/radiosonde_auto_rx/auto_rx/auto_rx.py
""",True,'Radiosonde'))

# SdrGlut
programs_dragonOS_noble.append(('SdrGlut (63.21 MB)',
"""sudo apt-get install -y build-essential libwxgtk3.2-dev libglew-dev libusb-dev libsoapysdr-dev libopenal-dev libliquid-dev freeglut3-dev libalut-dev libsndfile1-dev librtaudio-dev libhdf4-dev libfftw3-dev
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone --depth=1 https://github.com/righthalfplane/SdrGlut.git
cd SdrGlut
make -f makefileUbuntu -j 8
cd iqSDR
make -f makefileUbuntuOLD -j 8
########## Verify ##########
ls ~/Installed_by_FISSURE/SdrGlut/sdrglut.x
""",True,'SDR'))

# rehex
programs_dragonOS_noble.append(('rehex (646.61 MB)',
"""sudo apt-get install -y build-essential git libwxgtk3.2-dev libjansson-dev libcapstone-dev liblua5.3-dev lua5.3 lua5.2 libunistring-dev libgtk-3-dev lua-busted libbotan-2-dev
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/solemnwarning/rehex.git
cd rehex
sudo git config --global --add safe.directory """ + os.path.expanduser('~') + """/Installed_by_FISSURE/rehex
yes | sudo cpan Template
sudo make install
########## Verify ##########
ls /usr/local/bin/rehex 
""",True,'Data'))

# ZEPASSD
programs_dragonOS_noble.append(('ZEPASSD (8.66 MB)',
"""#sudo apt-get install -y # boost.program-options, boost.crc, boost.circular-buffer, libfftw3, libuhd 3.9.5 or later
sudo apt-get install -y libuhd-dev
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/pvachon/zepassd.git
cd zepassd
make
########## Verify ##########
ls ~/Installed_by_FISSURE/zepassd/zepassd
""",True,'RFID'))

# iridium-toolkit
programs_dragonOS_noble.append(('iridium-toolkit (3.64 MB)',
"""#Python (2.7), NumPy (scipy), crcmod
sudo apt-get install -y mplayer
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/muccc/iridium-toolkit.git
git clone git://git.osmocom.org/osmo-ir77
cd osmo-ir77/codec/
sudo make
cp ir77_ambe_decode ~/Installed_by_FISSURE/iridium-toolkit/
########## Verify ##########
ls ~/Installed_by_FISSURE/osmo-ir77/codec/ir77_ambe_decode
""",True,'Satellite'))

# IridiumLive
programs_dragonOS_noble.append(('IridiumLive (92.71 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/microp11/iridiumlive.git
wget -P ~/Installed_by_FISSURE/ https://github.com/microp11/iridiumlive/releases/download/v1.2/linux-x64.zip
unzip -q linux-x64.zip
rm linux-x64.zip
cd linux-x64
sudo chmod +x IridiumLive
########## Verify ##########
ls ~/Installed_by_FISSURE/linux-x64/IridiumLive
""",True,'Satellite'))

# NETATTACK2 - Fix
programs_dragonOS_noble.append(('NETATTACK2',
"""#sudo pip install netifaces  # fix for python2
#sudo apt-get install -y python-scapy python-nmap python-nfqueue nmap  # this needs to be fixed, can it still run with python2?
sudo python2 -m pip install netifaces
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/chrizator/netattack2.git
sudo python2 -m pip install nmap
cd netattack2
wget http://archive.ubuntu.com/ubuntu/pool/universe/libn/libnetfilter-queue/libnetfilter-queue1_1.0.2-2_amd64.deb
sudo dpkg -i libnetfilter-queue1_1.0.2-2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/nfqueue-bindings/python-nfqueue_0.6-1build2_amd64.deb
sudo dpkg -i python-nfqueue_0.6-1build2_amd64.deb 
""",False,'802.11'))

# Wifite
programs_dragonOS_noble.append(('Wifite (159.01 MB)',
"""echo "macchanger macchanger/automatically_run boolean false" | sudo debconf-set-selections
# python, iwconfig, ifconfig, Aircrack-ng, tshark, reaver, bully, coWPAtty, pyrit, hashcat, hcxdumptool, hcxpcaptool
sudo apt-get install -y build-essential libpcap-dev aircrack-ng pixiewps libssl-dev hashcat libcurl4-openssl-dev pkg-config macchanger python-is-python3
sudo python3 -m pip install psycopg2-binary --break-system-packages  #scapy (python3 scapy with pip causes errors)
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/derv82/wifite2.git
git clone https://github.com/t6x/reaver-wps-fork-t6x
cd reaver-wps-fork-t6x/src
./configure
make
sudo make install
cd ~/Installed_by_FISSURE
git clone https://github.com/aanarchyy/bully
cd bully/src
make
sudo make install
cd ~/Installed_by_FISSURE
wget http://www.willhackforsushi.com/code/cowpatty/4.6/cowpatty-4.6.tgz
tar zxfv cowpatty-4.6.tgz
rm cowpatty-4.6.tgz
cd cowpatty-4.6
make
sudo cp cowpatty /usr/bin
cd ~/Installed_by_FISSURE
mkdir Pyrit-v0.5.0
cd Pyrit-v0.5.0
wget https://github.com/JPaulMora/Pyrit/releases/download/v0.5.0/Pyrit-v0.5.0.zip
unzip -q Pyrit-v0.5.0.zip
rm Pyrit-v0.5.0.zip
sudo apt-get install -y python2-dev
python2 setup.py clean
python2 setup.py build
sudo python2 setup.py install
cd ~/Installed_by_FISSURE
git clone https://github.com/ZerBea/hcxdumptool.git
cd hcxdumptool
make
sudo make install
cd ~/Installed_by_FISSURE
git clone https://github.com/ZerBea/hcxtools.git
cd hcxtools
make
sudo make install
sudo ln -s /usr/bin/hcxpcapngtool /usr/bin/hcxpcaptool
#sudo apt-get install -y tshark
sudo sed -i 's/python/python3/g' ~/Installed_by_FISSURE/wifite2/Wifite.py
""",True,'802.11'))

# # rtl_433
# programs_dragonOS_noble.append(('rtl_433',
# """#sudo apt-get install -y rtl-433
# sudo apt-get install -y libtool libusb-1.0-0-dev librtlsdr-dev rtl-sdr build-essential cmake pkg-config
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://github.com/merbanan/rtl_433.git
# cd rtl_433/
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# ########## Verify ##########
# rtl_433 -help
# """,True,'433 MHz'))

# RouterSploit
programs_dragonOS_noble.append(('RouterSploit (359.61 MB)',
"""sudo apt-get install -y python3-pip libglib2.0-dev rustc
sudo python3 -m pip install setuptools-rust --break-system-packages
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://www.github.com/threat9/routersploit
cd routersploit
python3 -m pip install setuptools --break-system-packages
python3 -m pip install -r requirements.txt --break-system-packages
python3 -m pip install bluepy --break-system-packages
########## Verify ##########
~/Installed_by_FISSURE/routersploit/rsf.py --help
""",True,'802.11'))

# Metasploit
programs_dragonOS_noble.append(('Metasploit (1.28 GB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
mkdir metasploit
cd metasploit
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall
########## Verify ##########
ls /usr/bin/msfconsole
""",True,'802.11'))

# monitor_rtl433
programs_dragonOS_noble.append(('monitor_rtl433 (54.96 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/mcbridejc/monitor_rtl433.git
cd monitor_rtl433
sudo python3 -m pip install . --force-reinstall --ignore-installed --break-system-packages
sudo python3 -m pip install python-dateutil --break-system-packages
sudo python3 -m pip install flask_table --break-system-packages
########## Verify ##########
ls /usr/local/bin/monitor_rtl433
""",True,'433 MHz'))

# scan-ssid
programs_dragonOS_noble.append(('scan-ssid (240.00 kB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
sudo apt-get install -y iw
git clone https://github.com/Resethel/scan-ssid.git
cd scan-ssid
sudo cp scan-ssid /usr/local/bin
sudo chmod 755 /usr/local/bin/scan-ssid  # can't be in monitor mode, managed only
########## Verify ##########
scan-ssid --help
""",True,'802.11'))

# minimodem
programs_dragonOS_noble.append(('minimodem (108.00 kB)',
"""sudo apt-get install -y minimodem
########## Verify ##########
minimodem --version
""",True,'Audio'))

# # WSJT-X
# programs_dragonOS_noble.append(('WSJT-X',
# """sudo apt-get install -y wsjtx
# ########## Verify ##########
# ls /usr/bin/wsjtx
# """,True,'Ham Radio'))

# Google Earth Pro
programs_dragonOS_noble.append(('Google Earth Pro (300.18 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
wget https://dl.google.com/dl/earth/client/current/google-earth-pro-stable_current_amd64.deb
sudo dpkg -i google-earth-pro-stable_current_amd64.deb
########## Verify ##########
ls /usr/bin/google-earth-pro
""",True,'Mapping'))

# gr-air-modes
programs_dragonOS_noble.append(('gr-air-modes (3.06 MB)',
"""sudo apt-get install -y gr-air-modes
sudo sed -i 's/numpy.float)/numpy.float32)/g' /usr/lib/python3/dist-packages/air_modes/mlat.py  # Deprecated numpy type: np.float->np.float32 or np.float64
########## Verify ##########
modes_rx --help
""",True,'Aircraft'))

# ESP8266 Deauther v2
programs_dragonOS_noble.append(('ESP8266 Deauther v2 (5.90 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
wget https://github.com/SpacehuhnTech/esp8266_deauther/archive/v2.zip
unzip -q v2.zip
rm v2.zip
""",True,'802.11'))

# Viking
programs_dragonOS_noble.append(('Viking (306.61 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone git://git.code.sf.net/p/viking/code viking
sudo apt install -y gtk-doc-tools docbook-xsl yelp-tools libpng-dev libgtk-3-dev libicu-dev libjson-glib-dev intltool
sudo apt-get install -y libcurl4-gnutls-dev libglib2.0-dev-bin
sudo apt-get install -y libsqlite3-dev nettle-dev libmapnik-dev libgeoclue-2-dev libgexiv2-dev libgps-dev libmagic-dev libbz2-dev libzip-dev liboauth-dev
sudo apt-get install -y autopoint libnova-dev
cd viking
./autogen.sh
./configure
make
sudo make install
########## Verify ##########
viking --help
""",True,'Mapping'))

# PyGPSClient
programs_dragonOS_noble.append(('PyGPSClient (12.54 MB)',
"""sudo apt install -y python3-pip python3-tk python3-pil python3-pil.imagetk
sudo apt remove -y python3-cryptography
sudo python3 -m pip install --upgrade PyGPSClient --break-system-packages
########## Verify ##########
ls /usr/local/bin/pygpsclient
""",True,'GPS'))

# # Gpredict
# programs_dragonOS_noble.append(('Gpredict',
# """sudo apt-get install -y gpredict
# ########## Verify ##########
# gpredict --help
# """,True,'GPS'))

# FoxtrotGPS
programs_dragonOS_noble.append(('FoxtrotGPS (2.14 MB)',
"""sudo apt-get install -y foxtrotgps
########## Verify ##########
foxtrotgps --help
""",True,'GPS'))

# # multimon-ng
# programs_dragonOS_noble.append(('multimon-ng',
# """sudo apt-get install -y libpulse-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://github.com/EliasOenal/multimonNG.git
# cd multimonNG
# mkdir build
# cd build
# qmake ../multimon-ng.pro
# make
# sudo make install
# ########## Verify ##########
# ls /usr/local/bin/multimon-ng
# """,True,'POCSAG'))

# Xastir
programs_dragonOS_noble.append(('Xastir (41.37 MB)',
"""echo 'xastir xastir/setuid boolean true' | sudo debconf-set-selections
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y xastir
########## Verify ##########
sudo xastir -V
""",True,'Ham Radio'))

# # LTE-Cell-Scanner
# programs_dragonOS_noble.append(('LTE-Cell-Scanner',
# """sudo apt-get install -y cmake libncurses5-dev liblapack-dev libblas-dev libboost-thread-dev libboost-system-dev libitpp-dev librtlsdr-dev libfftw3-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://github.com/JiaoXianjun/LTE-Cell-Scanner.git
# cd LTE-Cell-Scanner
# mkdir build
# cd build
# sed -i -E 's/[Cc][Mm][Aa][Kk][Ee]_MINIMUM_REQUIRED\s*\(\s*VERSION\s+2\.[0-9]+(\.[0-9]+)?\s*\)/cmake_minimum_required(VERSION 3.5)/' ~/Installed_by_FISSURE/LTE-Cell-Scanner/CMakeLists.txt
# cmake ..
# make 
# sudo make install
# ########## Verify ##########
# ls /usr/local/bin/CellSearch
# """,True,'LTE'))

# btscanner
programs_dragonOS_noble.append(('btscanner (1.12 MB)',
"""sudo apt-get install -y btscanner
########## Verify ##########
btscanner --help
""",True,'Bluetooth'))

# hcidump
programs_dragonOS_noble.append(('hcidump (560.00 kB)',
"""sudo apt-get install -y bluez-hcidump
########## Verify ##########
hcidump --help
""",True,'Bluetooth'))

# GraphicsMagick
programs_dragonOS_noble.append(('GraphicsMagick (5.24 MB)',
"""sudo apt-get install -y graphicsmagick-imagemagick-compat
########## Verify ##########
gm -help
""",True,'SDR'))

# Spectrum Painter
programs_dragonOS_noble.append(('Spectrum Painter (7.40 MB)',
"""sudo python3 -m pip install numpy imageio --break-system-packages 
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/polygon/spectrum_painter.git
#cd spectrum_painter/
#pip3 install --user -e .  # call with "python3 -m spectrum_painter.img2iqstream --break-system-packages"
""",True,'SDR'))

# nrsc5 and nrsc5-gui
programs_dragonOS_noble.append(('nrsc5 (135.57 MB)',
"""sudo apt install -y git build-essential cmake autoconf libtool libao-dev libfftw3-dev librtlsdr-dev libgsl-dev python3-pyaudio
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/theori-io/nrsc5.git
cd nrsc5
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig
# nrsc5-gui
python3 -m pip install --upgrade Pillow --break-system-packages
python3 -m pip install pyaudio --break-system-packages
sudo apt-get install -y python-gobject
cd ~/Installed_by_FISSURE
git clone https://github.com/cmnybo/nrsc5-gui.git
########## Verify ##########
nrsc5 -v
""",True,'HD Radio'))

# HAM2MON
programs_dragonOS_noble.append(('HAM2MON (876.00 kB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/bkerler/ham2mon.git
cp -f """ + fissure_directory + """/Tools/ham2mon/cursesgui.py ~/Installed_by_FISSURE/ham2mon/apps/
""",True,'Ham Radio'))

# Anki
programs_dragonOS_noble.append(('Anki (10.85 MB)',
"""sudo apt-get install -y anki
########## Verify ##########
anki -h
""",True,'Ham Radio'))

# Bless
programs_dragonOS_noble.append(('Bless',
"""sudo apt-get install -y --alow-change-held-packages git snapd
sudo snap install bless-unofficial
########## Verify ##########
snap list bless-unofficial
""",True,'Data'))

# trackerjacker - Fix (needs newer scapy version, something else (netattack2?) resets it, some pieces don't work while running it)
programs_dragonOS_noble.append(('trackerjacker (2.51 MB)',
"""sudo ln -s -f /usr/lib/x86_64-linux-gnu/libc.a /usr/lib/x86_64-linux-gnu/liblibc.a  # Python3.9 missing file
sudo sed -i 's/tostring/tobytes/g' /usr/local/lib/python3.10/dist-packages/scapy/arch/linux.py
sudo python3 -m pip install trackerjacker --break-system-packages
########## Verify ##########
sudo trackerjacker --help
""",True,'802.11'))

# airgeddon
programs_dragonOS_noble.append(('airgeddon (200.43 MB)',
"""sudo apt-get install -y crunch mdk3 hostapd lighttpd ruby-dev xterm isc-dhcp-server ettercap-text-only john
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone --depth 1 https://github.com/v1s1t0r1sh3r3/airgeddon.git
#asleap
mkdir asleap
cd asleap
wget http://http.kali.org/pool/main/a/asleap/asleap_2.3~git20201128.254acab-0kali1_amd64.deb
sudo dpkg -i asleap_2.3~git20201128.254acab-0kali1_amd64.deb
#bettercap
sudo apt-get install -y build-essential libpcap-dev net-tools 
cd ~/Installed_by_FISSURE
mkdir bettercap
cd bettercap
wget https://github.com/bettercap/bettercap/releases/download/v2.31.1/bettercap_linux_amd64_v2.31.1.zip
unzip -q bettercap_linux_amd64_v2.31.1.zip
rm bettercap_linux_amd64_v2.31.1.zip
sudo cp bettercap /usr/bin/
#mdk4
sudo apt-get install -y libnl-genl-3-dev
cd ~/Installed_by_FISSURE
git clone https://github.com/aircrack-ng/mdk4
cd mdk4
make
sudo make install
""",True,'802.11'))

# Hydra
programs_dragonOS_noble.append(('Hydra (19.06 MB)',
"""sudo apt-get install -y hydra
########## Verify ##########
ls /usr/bin/hydra
""",True,'SSH'))

# Enscribe
programs_dragonOS_noble.append(('Enscribe (88.00 kB)',
"""sudo apt-get install -y enscribe
########## Verify ##########
ls /usr/bin/enscribe
""",True,'Audio'))

# ESP32 Bluetooth Classic Sniffer
programs_dragonOS_noble.append(('ESP32 BT Classic Sniffer',
"""# Now contains errors caused by newer wireshark versions. Not supporting this until it is fixed.
mkdir -p ~/Installed_by_FISSURE  # Requires Wireshark 3.4 by default, modifying it for 3.6.5, 4.0.3, 4.2.5, 4.4.0, 4.2.2
cd ~/Installed_by_FISSURE
git clone https://github.com/Matheus-Garbelini/esp32_bluetooth_classic_sniffer
cd esp32_bluetooth_classic_sniffer
#rm ./dissectors/config.h  # Produces errors if missing
sed -i 's/VERSION "3.4.0"/VERSION "4.2.2"/g' ./dissectors/config.h
sed -i 's/VERSION_MAJOR 3/VERSION_MAJOR 4/g' ./dissectors/config.h
sed -i 's/VERSION_MINOR 4/VERSION_MINOR 2/g' ./dissectors/config.h
sed -i 's/VERSION_MICRO 0/VERSION_MICRO 2/g' ./dissectors/config.h
sed -i 's/PLUGIN_PATH_ID "3.4"/PLUGIN_PATH_ID "4.2"/g' ./dissectors/config.h
sed -i 's/Bluetooth Link Manager Protocol/ESP32 Bluetooth Link Manager Protocol/g' ./dissectors/packet-btbrlmp.c
sed -i 's/btlmp/esp32_btlmp/g' ./dissectors/packet-btbrlmp.c
sed -i 's/3.4/4.2/g' ./dissectors/build.sh
sudo ./requirements.sh
./build.sh
sudo cp dissectors/h4bcm.so /usr/lib/x86_64-linux-gnu/wireshark/plugins/4.2/epan/  # Placing it where "sudo Wireshark" dissectors are located
rm ~/.local/lib/wireshark/plugins/4.2/epan/h4bcm.so  # To avoid "plugin 'h4bcm.so' was found in multiple directories" warning
########## Verify ##########
ls /usr/lib/x86_64-linux-gnu/wireshark/plugins/4.4/epan/h4bcm.so
""",False,'Bluetooth'))

# # SigDigger
# programs_dragonOS_noble.append(('SigDigger',
# """sudo apt-get install -y libsndfile1-dev libfftw3-dev qmake6 soapysdr-tools libsoapysdr-dev fuse
# mkdir -p ~/Installed_by_FISSURE/SigDigger
# cd ~/Installed_by_FISSURE/SigDigger
# wget https://github.com/BatchDrake/SigDigger/releases/download/v0.3.0/SigDigger-0.3.0-x86_64-full.AppImage  # Needs newer version of QMake. Above 5.12.8, 5.14?
# chmod a+x SigDigger-0.3.0-x86_64-full.AppImage
# ########## Verify ##########
# ls ~/Installed_by_FISSURE/SigDigger/SigDigger-0.3.0-x86_64-full.AppImage
# """,True,'SDR'))

# # QSSTV
# programs_dragonOS_noble.append(('QSSTV',
# """sudo apt-get install -y qsstv
# ########## Verify ##########
# ls /usr/bin/qsstv
# """,True,'Ham Radio'))

# # m17-cxx-demod
# programs_dragonOS_noble.append(('m17-cxx-demod',
# """sudo apt-get install -y libcodec2-dev libboost-dev libgtest-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://bitbucket.org/blaze-lib/blaze.git
# sudo mkdir -p /usr/local/include/blaze
# sudo cp -r blaze/blaze /usr/local/include/
# cd ~/Installed_by_FISSURE
# git clone https://github.com/mobilinkd/m17-cxx-demod.git
# cd m17-cxx-demod/
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# ########## Verify ##########
# ls /usr/local/bin/m17-demod
# """,True,'M17'))

# # Fldigi
# programs_dragonOS_noble.append(('Fldigi',
# """sudo apt-get install -y fldigi
# ########## Verify ##########
# ls /usr/bin/fldigi
# """,True,'Ham Radio'))

# pyFDA
programs_dragonOS_noble.append(('pyFDA (107.33 MB)',
"""sudo python3 -m pip install pyfda --use-pep517 --break-system-packages  # Has PEP issues with Python 3.10
########## Verify ##########
pyfdax -h
""",True,'Filters'))

# Bootable USB
programs_dragonOS_noble.append(('Bootable USB (64.18 MB)',
"""sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 382003C2C8B7B4AB813E915B14E4942973C62A1B
sudo add-apt-repository -y "deb http://ppa.launchpad.net/nemh/systemback/ubuntu xenial main"
sudo apt update
sudo apt install -y systemback
sudo add-apt-repository -y ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install -y mkusb usb-pack-efi mkusb-plug guidus
########## Verify ##########
ls /usr/bin/systemback && ls /usr/bin/guidus
""",True,'Development'))

# # Dire Wolf
# programs_dragonOS_noble.append(('Dire Wolf',
# """sudo apt-get -y install git gcc g++ make cmake libasound2-dev libudev-dev
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://www.github.com/wb2osz/direwolf
# cd direwolf
# git checkout dev
# mkdir build && cd build
# cmake ..
# make -j4
# sudo make install
# make install-conf
# ########## Verify ##########
# ls /usr/local/bin/direwolf
# """,True,'Ham Radio'))

# Meld
programs_dragonOS_noble.append(('Meld (11.35 MB)',
"""sudo apt-get -y install meld
########## Verify ##########
ls /usr/bin/meld
""",True,'Data'))

# nwdiag
programs_dragonOS_noble.append(('nwdiag (29.34 MB)',
"""sudo python3 -m pip install nwdiag --break-system-packages
########## Verify ##########
packetdiag -h
""",True,'Data'))

# HamClock
programs_dragonOS_noble.append(('HamClock (47.96 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
wget https://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip
unzip -q ESPHamClock.zip
rm ESPHamClock.zip
cd ESPHamClock
make install hamclock-1600x960
sudo make install hamclock-1600x960
########## Verify ##########
ls /usr/local/bin/hamclock
""",True,'Ham Radio'))

# # ICE9 Bluetooth Sniffer
# programs_dragonOS_noble.append(('ICE9 Bluetooth Sniffer',
# """sudo apt install -y libliquid-dev libbtbb-dev libuhd-dev
# sudo apt-get install -y libhackrf-dev libbladerf-dev  # Separating in case there are conflicts with Hardware install
# mkdir -p ~/Installed_by_FISSURE
# cd ~/Installed_by_FISSURE
# git clone https://github.com/mikeryan/ice9-bluetooth-sniffer.git
# cd ice9-bluetooth-sniffer
# mkdir build
# cd build
# cmake ..
# make
# sudo make install
# ########## Verify ##########
# ls ~/Installed_by_FISSURE/ice9-bluetooth-sniffer/build/ice9-bluetooth
# """,True,'Bluetooth'))

# dump978
programs_dragonOS_noble.append(('dump978 (1.15 MB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/mutability/dump978.git
cd dump978
make
########## Verify ##########
ls ~/Installed_by_FISSURE/dump978/dump978
""",True,'Aircraft'))

# # htop
# programs_dragonOS_noble.append(('htop',
# """sudo apt-get install -y htop
# ########## Verify ##########
# ls /usr/bin/htop
# """,True,'Development'))

# # OpenWebRX
# programs_dragonOS_noble.append(('OpenWebRX',
# """wget -O - https://repo.openwebrx.de/debian/key.gpg.txt | sudo apt-key add
# echo 'deb https://repo.openwebrx.de/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/openwebrx.list
# sudo apt-get update
# sudo apt-get install -y openwebrx
# sudo systemctl stop openwebrx
# sudo systemctl disable openwebrx  # Prevents starting on boot
# ########## Verify ##########
# ls /usr/bin/openwebrx
# """,False,'SDR'))

# CRC RevEng
programs_dragonOS_noble.append(('CRC RevEng (884.00 kB)',
"""mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
wget -T 10 https://sourceforge.net/projects/reveng/files/3.0.5/reveng-3.0.5.zip/download
unzip download
rm download
cd reveng-3.0.5
make
########## Verify ##########
ls ~/Installed_by_FISSURE/reveng-3.0.5/bin/i386-linux/reveng
""",True,'Data'))

# wl-color-picker
programs_dragonOS_noble.append(('wl-color-picker (440.00 kB)',
"""sudo apt-get install -y slurp grim wl-clipboard
cd ~/Installed_by_FISSURE
git clone https://github.com/jgmdev/wl-color-picker.git
########## Verify ##########
ls ~/Installed_by_FISSURE/wl-color-picker/wl-color-picker.sh
""",True,'Development'))

# GHex
programs_dragonOS_noble.append(('GHex (3.35 MB)',
"""sudo apt-get install -y ghex
########## Verify ##########
ls /usr/bin/ghex
""",True,'Data'))

# Archive Flow Graphs
programs_dragonOS_noble.append(('Archive Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Archive\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# Fuzzing Flow Graphs
programs_dragonOS_noble.append(('Fuzzing Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Fuzzing\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# Inspection Flow Graphs
programs_dragonOS_noble.append(('Inspection Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Inspection\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# IQ Flow Graphs
programs_dragonOS_noble.append(('IQ Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/IQ\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# PD Flow Graphs
programs_dragonOS_noble.append(('PD Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/PD\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# Single-Stage Flow Graphs
programs_dragonOS_noble.append(('Single-Stage Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Single-Stage\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# Sniffer Flow Graphs
programs_dragonOS_noble.append(('Sniffer Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Sniffer\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# Standalone Flow Graphs
programs_dragonOS_noble.append(('Standalone Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Standalone\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# TSI Flow Graphs
programs_dragonOS_noble.append(('TSI Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/TSI\ Flow\ Graphs/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# Trigger Flow Graphs
programs_dragonOS_noble.append(('Trigger Flow Graphs',
"""cd """ + fissure_directory + """/Flow\ Graph\ Library/maint-3.10/Triggers/
find . -name '*.grc' -exec grcc {} \;
""",True,'Compile Flow Graphs'))

# pyais
programs_dragonOS_noble.append(('pyais (684.00 kB)',
"""sudo python3 -m pip install pyais --break-system-packages
########## Verify ##########
ls /usr/local/lib/python3*/dist-packages/pyais
""",True,'AIS'))

# HAMRS
programs_dragonOS_noble.append(('HAMRS (100.91 MB)',
"""mkdir -p ~/Installed_by_FISSURE/HAMRS
cd ~/Installed_by_FISSURE/HAMRS
wget https://hamrs-releases.s3.us-east-2.amazonaws.com/1.0.6/hamrs-1.0.6-linux-x86_64.AppImage
sudo chmod +x hamrs*
########## Verify ##########
ls ~/Installed_by_FISSURE/HAMRS/hamrs*
""",True,'Ham Radio'))

# Binwalk
programs_dragonOS_noble.append(('Binwalk (29.34 MB)',
"""sudo apt-get install -y python3-binwalk binwalk  # prone to nfqueue issue, use: sudo apt --fix-broken
########## Verify ##########
ls /usr/bin/binwalk
""",True,'Data'))

# Read the Docs
programs_dragonOS_noble.append(('Read the Docs (53.64 MB)',
"""sudo python3 -m pip install sphinx --break-system-packages
sudo python3 -m pip install sphinx_rtd_theme --break-system-packages
########## Verify ##########
sudo python3 -m pip show sphinx_rtd_theme
""",True,'Development'))

# IQEngine
programs_dragonOS_noble.append(('IQEngine (48.32 MB)',
"""if command -v docker > /dev/null 2>&1; then
  echo "Docker is installed."
else
  echo "Docker is not installed."
  sudo apt-get install -y docker.io
  #sudo systemctl start docker
  #sudo systemctl enable docker
  sudo usermod -aG docker ${USER}  # Reboot computer to use docker commands without sudo
  #newgrp docker
fi
mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE
git clone https://github.com/IQEngine/IQEngine.git
cd ~/Installed_by_FISSURE/IQEngine
cp example.env .env
docker run --env-file .env -v '""" + fissure_directory + """/IQ Recordings':/tmp/myrecordings -p 3001:3000 --pull=always -d ghcr.io/iqengine/iqengine:pre
docker stop $(docker ps -q --filter ancestor=ghcr.io/iqengine/iqengine:pre)
########## Verify ##########
sudo docker run hello-world
""",True,'Data'))

# TAK Server
programs_dragonOS_noble.append(('TAK Server',
"""# Create TAK.gov account and download TAKSERVER-DOCKER-#.#-RELEASE-##.ZIP from https://tak.gov/products/tak-server
# Place ZIP file in ~/Installed_by_FISSURE folder and then run this installer item!

if command -v docker > /dev/null 2>&1; then
  echo "Docker is installed."
else
  echo "Docker is not installed."
  sudo apt-get install -y docker.io
  #sudo systemctl start docker
  #sudo systemctl enable docker
  sudo usermod -aG docker ${USER}  # Reboot computer to use docker commands without sudo
  #newgrp docker
fi

mkdir -p ~/Installed_by_FISSURE
cd ~/Installed_by_FISSURE

# Unzip and move into the extracted directory
unzip takserver-docker-*.zip
if [ -n "$(find . -maxdepth 1 -type d -name 'takserver-docker-*' -print -quit)" ]; then
    cd takserver-docker-*/

    # Ensure CoreConfig.xml exists
    [ ! -f tak/CoreConfig.xml ] && cp tak/CoreConfig.example.xml tak/CoreConfig.xml

    # Set database password
    sed -i 's/password=""/password="atakatak"/' tak/CoreConfig.xml

    # Build and start the database
    sudo docker build -t takserver-db:"$(cat tak/version.txt)" -f docker/Dockerfile.takserver-db .
    sudo docker network create takserver-"$(cat tak/version.txt)"

    # Set executable permissions for necessary scripts
    chmod +x tak/db-utils/configureInDocker.sh
    chmod +x tak/certs/makeRootCa.sh
    chmod +x tak/certs/makeCert.sh

    sudo docker run -d \
      -v $(pwd)/tak:/opt/tak:z \
      -p 5432:5432 \
      --network takserver-"$(cat tak/version.txt)" \
      --network-alias tak-database \
      --name takserver-db-"$(cat tak/version.txt)" \
      takserver-db:"$(cat tak/version.txt)"

    # Wait for the database to be fully ready
    echo "Waiting for PostgreSQL to be ready..."
    until sudo docker exec takserver-db-"$(cat tak/version.txt)" psql -U martiuser -d cot -c "SELECT 1;" &>/dev/null; do
        sleep 3
        echo "Waiting for database..."
    done
    echo "Database is ready!"

    # Build and start TAK Server
    sudo docker build -t takserver:"$(cat tak/version.txt)" -f docker/Dockerfile.takserver .
    sudo docker run -d \
      -v $(pwd)/tak:/opt/tak:z \
      -p 8089:8089 -p 8443:8443 -p 8444:8444 -p 8446:8446 -p 9000:9000 -p 9001:9001 \
      --network takserver-"$(cat tak/version.txt)" \
      --name takserver-"$(cat tak/version.txt)" \
      takserver:"$(cat tak/version.txt)"

    # Modify certificate metadata
    sed -i 's/^STATE=.*/STATE="test_state"/' tak/certs/cert-metadata.sh
    sed -i 's/^CITY=.*/CITY="test_city"/' tak/certs/cert-metadata.sh
    sed -i 's/^ORGANIZATIONAL_UNIT=.*/ORGANIZATIONAL_UNIT="test_organization"/' tak/certs/cert-metadata.sh
    sed -i 's/^ORGANIZATION=.*/ORGANIZATION="test_org"/' tak/certs/cert-metadata.sh

    # Generate Root CA
    sudo docker exec takserver-"$(cat tak/version.txt)" bash -c "cd /opt/tak/certs && ./makeRootCa.sh"

    # Ensure CA certificate exists before continuing
    sudo docker exec takserver-"$(cat tak/version.txt)" bash -c "test -f /opt/tak/certs/files/ca.pem || (echo 'CA generation failed!' && exit 1)"

    # Generate Certificates
    sudo docker exec takserver-"$(cat tak/version.txt)" bash -c "cd /opt/tak/certs && ./makeCert.sh server takserver"
    sudo docker exec takserver-"$(cat tak/version.txt)" bash -c "cd /opt/tak/certs && ./makeCert.sh client admin"
    sudo docker exec takserver-"$(cat tak/version.txt)" bash -c "cd /opt/tak/certs && ./makeCert.sh client webadmin"

    # Ensure directories have correct permissions
    sudo find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -type d -exec chmod 755 {} +
      
    sudo openssl rsa -in "$(find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -name 'takserver.key' | head -n 1)" \
        -out "$(find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -type d | head -n 1)/takserver.key.unencrypted" \
        -passin pass:"atakatak"

    sudo mv "$(ls -d ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files | head -n 1)/takserver.key.unencrypted" \
      "$(ls -d ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files | head -n 1)/takserver.key"

    # Set ownership for all certificate-related files to the current user
    sudo find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -type f -exec chown $USER:$USER {} +
    sudo find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -type d -exec chown $USER:$USER {} +

    # Set proper permissions for private keys
    sudo find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -type f -name "*.key" -exec chmod 644 {} +

    # Set correct permissions for other certificate files
    sudo find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -type f -not -name "*.key" -exec chmod 644 {} +

    # Restart TAK Server to apply changes
    sudo docker restart takserver-"$(cat tak/version.txt)"

    # Copy takserver.key and takserver.pem to FISSURE Config Files
    cd """ + fissure_directory + """
    PYTHONPATH=""" + fissure_directory + """ python3 fissure/utils/tak_yaml_key_insert.py \
    "$(find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -name 'takserver.key' | head -n 1)" \
    "$(find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -name 'takserver.pem' | head -n 1)" \
    "$(find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -name 'webadmin.p12' | head -n 1)" \
    "$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' takserver-5.3-RELEASE-24)"
    python3 -m pip install pytak --break-system-packages
    # Import webadmin.p12:

    # Google Chrome/Edge
    # Open chrome://settings/certificates in your browser.
    # Go to the "Your certificates" tab.
    # Click "Import".
    # Select /home/cups-pk-helper/webadmin.p12.
    # Enter the password (default: atakatak, unless changed).
    # Complete the import and restart your browser.

    # Mozilla Firefox
    # Open about:preferences#privacy in the Firefox address bar.
    # Scroll down to Certificates and click "View Certificates".
    # Go to the "Your Certificates" tab.
    # Click "Import".
    # Select /home/cups-pk-helper/webadmin.p12 and enter the password (atakatak).
    # Restart Firefox.

    # To Remove TAK:
    # docker ps -a | grep takserver
    # docker rm -f $(docker ps -aq --filter "name=takserver")
    # docker rm -f $(docker ps -aq --filter "name=takserver-db")
    # docker ps -a
    # docker images | grep takserver
    # docker rmi -f $(docker images -q takserver)
    # docker rmi -f $(docker images -q takserver-db)
    # docker images
    # docker network ls | grep takserver
    # docker network rm $(docker network ls --filter "name=takserver" -q)
    # sudo rm -rf ~/Installed_by_FISSURE/takserver-docker-*/

    echo ""
    echo "TAK Server setup complete! Import webadmin.p12 certificate via browser. Access WebTAK at https://localhost:8443"
    echo ""
else
    echo "TAK Server zip extraction failed or extracted folder not found. Exiting."
fi

########## Verify ##########
ls "$(find ~/Installed_by_FISSURE/takserver-docker-*/tak/certs/files/ -name 'webadmin.p12' | head -n 1)"
""",False,'Mapping'))

